[= AutoGen5 template texi

##  Documentation template
##
## Time-stamp:        "2008-09-13 10:31:35 bkorb"
## Author:            Bruce Korb <bkorb@gnu.org>
##
##  This file is part of AutoOpts, a companion to AutoGen.
##  AutoOpts is free software.
##  AutoOpts is copyright (c) 1992-2007 by Bruce Korb - all rights reserved
##
##  AutoOpts is available under any one of two licenses.  The license
##  in use must be one of these two and the choice is under the control
##  of the user of the license.
##
##   The GNU Lesser General Public License, version 3 or later
##      See the files "COPYING.lgplv3" and "COPYING.gplv3"
##
##   The Modified Berkeley Software Distribution License
##      See the file "COPYING.mbsd"
##
##  These files have the following md5sums:
##
##  239588c55c22c60ffe159946a760a33e pkg/libopts/COPYING.gplv3
##  fa82ca978890795162346e661b47161a pkg/libopts/COPYING.lgplv3
##  66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd
##
## ---------------------------------------------------------------------
## $Id: aginfo.tpl,v 4.5 2008/04/14 15:33:43 bkorb Exp $
## ---------------------------------------------------------------------

(setenv "SHELL" "/bin/sh")

=] \input texinfo   @c -*-texinfo-*-
@c %**start of header[= 

	(define downcase-prg-name ( string-downcase (get "prog-name")))=][=
 
	(define file-name         (string-append downcase-prg-name ".info"))

=]
@setfilename [= 

	(. file-name)

 =][=

	(define downcase-prog-title (string-downcase (get "prog-title")))

=]
@settitle [=

	prog-title 

=]
@c %**end of header

[=

	IF(exist? "texi-set-chapter-new-page") 

=][=

		CASE texi-set-chapter-new-page 

=][=
			= off
=]@setchapternewpage off[=
			= odd 
=]@setchapternewpage odd[=
			= on 
=]@setchapternewpage on[=

  		ESAC

=][=
	ENDIF
=]
@titlepage
@sp 10
@comment The title is printed in a large font.
@center @titlefont{Sample Title}

@c The following two commands start the copyright page.
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1990 Free Software Foundation, Inc.
@end titlepage

@node [= prog-name =] Invocation
@[=
 
 (define doc-level (getenv "LEVEL"))

 (define coded-prog-name (string-append "@code{"downcase-prg-name"}"))

 (define replace-prog-name (lambda (nm)
   (string-substitute (get nm)
     "ntpq"
     coded-prog-name )  ))

 (if (not (string? doc-level))
     (set! doc-level "section"))

 doc-level =]


[= (replace-prog-name "prog-title") =]

@node [= prog-name =]
@[=

 (define down-prog-name (string-downcase! (get "prog-name")))
 (define doc-level (getenv "LEVEL"))

 (define coded-prog-name (string-append "@code{" down-prog-name "}"))

 (define replace-prog-name (lambda (nm)
   (string-substitute (get nm)
     "@<prog-name>@"
     coded-prog-name )  ))

 (if (not (string? doc-level))
     (set! doc-level "section"))

 doc-level =][= (. replace-prog-name) =] [= (. coded-prog-name) =]Invoking [= prog_name =]
@pindex [= prog-name  =]
@cindex [= prog-title =]
[= (string-append "\n.PP\n" (get "prog-name") "\n") =]
[= (string-substitute (get "prog-name") "ntpq" "test") =][=
FOR concept =]
@cindex [= concept =][=
ENDFOR

=]
@ignore
[=
 (out-push-new (string-substitute (out-name) ".texi" ".menu"))
 
 (sprintf "* %-32s Invoking %s\n"
  (string-append (get "prog-name") " Invocation::")
  (get "prog-name") )

=]
[=
IF (exist? "prog-man-descrip")  =][=
  FOR prog-man-descrip  "\n\n"  =][=
    prog-man-descrip            =][=
  ENDFOR                         =][=
ELIF (exist? "detail")           =][=
  (replace-prog-name "detail")   =][=
ENDIF
=]
[=

  (out-pop #t)
  (dne "# " "# ")=]
[= (shell "perl test.pl") =]
@end ignore
[= ?% explain %s "This program has no explanation.\n" =]
[=
IF (exist? "prog-man-descrip")  =][=
  FOR prog-info-descrip  "\n\n"  =][=
    prog-info-descrip            =][=
  ENDFOR                         =][=
ELIF (exist? "detail")           =][=
  (replace-prog-name "detail")   =][=
ENDIF
=]
[=
IF (define opt-name "")
   (define extra-ct 0)
   (define extra-text "")
   (exist? "preserve-case")     =][=
   (define optname-from "_^")
   (define optname-to   "--")   =][=
ELSE                            =][=
  (define optname-from "A-Z")
  (define optname-to   "a-z") =][=
ENDIF                           =][=

FOR flag=][=

  IF (not (exist? "documentation")) =]

@node [=
    (set! opt-name (string-tr (get "prog-name") optname-from optname-to))
    (string-append down-prog-name " " opt-name)=]
[=ENDIF=]
[=ENDFOR=]
[= (. opt-name) =]
[= (set! extra-ct (+ extra-ct 1)) =]
[= (. extra-ct) =]
